//104
import BTree from "./index.js";
function maxDepth(root) {
  function travel(root, depth) {
    if (root === null) {
      return depth - 1;
    }
    const depth1 = travel(root.left, depth + 1);
    const depth2 = travel(root.right, depth + 1);
    return Math.max(depth1, depth2);
  }
  return travel(root, 1);
}
const node = new BTree([3, 9, 20, null, null, 15, 7]);
console.log(maxDepth(node));
